// 以下为官方示例
$().ready(function() {
    validateRule();
});

$.validator.setDefaults({
    submitHandler : function() {
        console.log('提交修改');
        update();
    }
});
function update() {
    $.ajax({
        url : "/common/generator/updateDb",
        type : "get",
        data :{
            dbIp:$("#dbIp").val(),
            dbPort:$("#dbPort").val(),
            dbName:$("#dbName").val(),
            dbUsername:$("#dbUsername").val(),
            dbPassword:$("#dbPassword").val(),
        },// 你的formid
        async : false,
        error : function(request) {
            parent.layer.alert("网络连接超时");
        },
        dataType:'json',
        success : function(data) {
            if(data.code==500){
                parent.layer.msg(data.msg);
            }else{
                parent.layer.msg("修改成功");
                parent.reLoad();
            }
        }
    });


}
function validateRule() {
    var icon = "<i class='fa fa-times-circle'></i> ";
    $("#signupForm").validate({
        rules : {
            author : {
                required : true
            },
            email : {
                required : true,
            },
            package : {
                required : true,
            },

        },
        messages : {

            author : {
                required : icon + "请输入作者"
            },
            email : {
                required : icon + "请输入email",
            },
            package : {
                required : icon + "请输入包名",
            },
        }
    })
}
